// 公共api
import fetch from '@/config/fetch'

// ------------------ 导出&下载 ----------------------
// 添加下载任务
export const addDownloadTask = data => fetch('/commons/add_export_task_view', data, 'POST');
// 获取下载任务列表
export const getExportTaskList = data => fetch('/commons/export_task_list_view', data);
// 删除下载任务
export const removeDownLoadTask = data => fetch('/commons/del_export_task_view', data, 'POST');
// 清空下载任务
export const removeAllTask = data => fetch('/commons/clear_export_task_view', data, 'POST');
// 下载文件
export const downloadFile = data => fetch('/commons/download_task_view', data);

// ------------------ 导入 ----------------------
// 添加导入任务
export const addImportTask = data => fetch('/commons/add_import_task_view', data, 'POST');
// 获取单个导入任务详情
export const getImportTaskInfo = data => fetch('/commons/import_task_single_view', data);
// 下载导入失败文件
export const downloadFailFile = data => fetch('/commons/download_import_error_file_view', data);

// ------------------ 支付相关 ----------------------
// 获取套餐价格列表
export const getPackageList = data => fetch('/commons/goods_item_config_list', data, 'POST');
// 生成商品购买订单
export const createProductOrder = data => fetch('/commons/goods_item_order_pay', data, 'POST');
// 获取支付状态
export const getPayStatus = data => fetch('/commons/order_pay_detail', data, 'POST');
// 支付回调
export const payCallback = data => fetch('/commons/uni_notify_pay', data, 'POST');
// 支付宝支付
export const aliPay = data => fetch('/commons/get_alipay_buy_url', data);
// 微信支付
export const wxPay = data => fetch('/commons/get_wxpay_buy_url', data);

// ------------------ 打印相关 ----------------------
// url转pdf
export const urlToPdf = data => fetch('/pdf_files/convert_pdf', data, 'POST');
// 绑定设备
export const bandDevice = data => fetch('/lianke_print/bind_devices', data, 'POST');
// 获取绑定设备
export const getBandDevices = data => fetch('/lianke_print/get_all_devices', data);
// 获取打印机列表
export const getPrintLists = data => fetch('/lianke_print/printer_list', data);
// 添加打印任务
export const addPrintTasks = data => fetch('/lianke_print/add_job', data, 'POST');
// 获取任务结果
export const getPrintTaskResult = data => fetch('/lianke_print/job_result', data, 'POST');

// 价格记忆设置
export const setPriceRemember = data => fetch('/corp/setting_save', data, 'POST');
// 价格记忆设置获取
export const getPriceRemember = data => fetch('/corp/setting_single', data, 'POST');
// 查询价格记忆数值
export const getPriceRememberValue = data => fetch('/goods_quotation/quotation_one/', data);

// 阿里云oss文件上传
export const uploadForAliOSS = data => fetch('/upload_file/ali_oss_priv', data, 'POST');


